import request from '@/utils/request'

export function add(data) {
  return request({
    url: '/role',
    method: 'post',
    data
  })
}

export function del(id) {
  return request({
    url: '/role/' + id,
    method: 'delete'
  })
}

export function edit(data) {
  return request({
    url: '/role',
    method: 'put',
    data
  })
}

export function getRole(id) {
  return request({
    url: '/role/' + id,
    method: 'get'
  })
}

export function listRole(params) {
  return request({
    url: '/role/list/' + params.pageNum + '/' + params.pageSize,
    method: 'get',
    params
  })
}

export function auth(data) {
  return request({
    url: '/role/auth',
    method: 'put',
    data
  })
}
export default { add, edit, del, getRole, listRole, auth }

